--item.cs--

ItemImageData MegatronGunImage
{
	shapeFile = "gunturet";
	mountPoint = 0;
	mountOffset = { -0.5, 0.2, -1.4 };
	mountRotation = { 0, 0, 0 };

	weaponType = 0; // Single Shot
	reloadTime = 0;
	fireTime = 0.3;
	minEnergy = 5;
	maxEnergy = 6;

	projectileType = BlasterBolt;
	accuFire = true;

	sfxFire = SoundFireBlaster;
	sfxActivate = SoundPickUpWeapon;
};

ItemData MegatronGun
{
	description = "Megatron Gun";
	className = "Weapon";
	shapeFile = "gunturet";
	hudIcon = "disk";
   heading = "bWeapons";
	shadowDetailMask = 4;
	imageType = MegatronGunImage;
	price = 0;
	showWeaponBar = true;
};

ItemImageData MegatronPackImage
{
	shapeFile = "mortarpack";
	mountPoint = 2;

	maxEnergy = 0;
	weaponType = 2;

	mountOffset= { 0, -0.05, 0 };
	mountRotation = { 0, 0, 0 };
	firstPerson = false;
};

ItemData MegatronPack
{
	description = "Megatron Transformation";
	className = "Backpack";
	shapeFile = "mortarpack";
	hudIcon = "shieldpack";
	heading = "cBackpacks";
	shadowDetailMask = 4;
	imageType = MegatronPackImage;
	price = 300;
	showWeaponBar = true;
	hiliteOnActive = false;
};

function transformToTurret(%player)
{
	%client = Player::getClient(%player);
	Player::mountItem(%player, MegatronGun, $WeaponSlot);
	Player::setArmor(%player, larmor);
}

function MegatronPackImage::onActivate(%player, %imageSlot)
{
	transformToTurret(%player);
}


function MegatronPackImage::onDeactivate(%player, %imageSlot)
{
	%client = Player::getClient(%player);
	Player::unmountItem(%player, $WeaponSlot);
	Player::setArmor(%player, tarmor);
}

--ArmorData.cs--
$ItemMax[tarmor, MegatronPack] = 1;

--Ideal.cs--
$InvList[MegatronPack] = 1;
$RemoteInvList[MegatronPack] = 1;
